//
//  HotTableViewCell.m
//  ArtOfLiving
//
//  Created by 刘虎 on 16/4/30.
//  Copyright © 2016年 刘虎. All rights reserved.
//

#import "HotTableViewCell.h"
#import "TravelNotesModel.h"

@interface HotTableViewCell ()

@property (weak, nonatomic) IBOutlet UIImageView *photoImageView;
@property (weak, nonatomic) IBOutlet UILabel *titleLabel;
@property (weak, nonatomic) IBOutlet UILabel *autherLabel;
@property (weak, nonatomic) IBOutlet UILabel *countLabel;
@property (weak, nonatomic) IBOutlet UILabel *answerLabel;

@property (weak, nonatomic) IBOutlet UIView *backView;

@end


@implementation HotTableViewCell

- (void)awakeFromNib {
    
    [super awakeFromNib];
    self.backView.layer.cornerRadius = 4.0f;
    self.photoImageView.layer.cornerRadius = 4.0f;
}

- (void)setCellWithModel:(id)model {
    
    TravelNotesModel *travelNoteModel = model;
    self.titleLabel.text = travelNoteModel.title;
    self.autherLabel.text = travelNoteModel.username;
    self.countLabel.text = [travelNoteModel.views stringValue];
    self.answerLabel.text = [NSString stringWithFormat:@"%@", travelNoteModel.replys];
    SDWebImageOptions options = SDWebImageRetryFailed | SDWebImageLowPriority;
    [self.photoImageView sd_setImageWithURL:[NSURL URLWithString:travelNoteModel.photo] placeholderImage:[UIImage imageNamed:@"travelPlaceholder.png"] options:options];
}



@end
